﻿using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;

[CustomEditor(typeof(TestScene))]
public class TestSceneGUI : Editor
{
    private void OnSceneGUI()
    {
        Handles.BeginGUI();

        if (GUILayout.Button("test1",GUILayout.Width(100))) {
            Debug.Log(target.name);
        }

        GUILayout.Label(target.name);

        Handles.EndGUI();


    }

    [InitializeOnLoadMethod]
    static void InitializeOnLoad() {

        SceneView.duringSceneGui += (sceneView) =>
        {
            Handles.BeginGUI();

            if (GUILayout.Button("test2",GUILayout.Width(100))) {
                Debug.Log("test2");
            }

            GUILayout.Label("弦风课堂");

            Handles.EndGUI();
        };

    }

}
